print(7 % 3)

print(4 ** 2)
print(4 ** 0.5)

print(7 // 3)
print(-7 // 2)

a = "hello"
b = "world"
print(a < b)
print(a > b)
print(a >= b)
print(a <= b)
print(a == b)
print(a != b)

print(0.1 + 0.2 == 0.3)
print(0.1 + 0.2)

a = 0.1 + 0.2
b = 0.3
#判断a-b的差值是否是一个很小的数字，在可允许的误差范围内
print(-0.0000001 < (a - b) < 0.0000001)

a = 10
b = 20
c = 30

# print(a < b and b < c) 这样写会有警告
print(a < b <c) #这样写更规范，这是Python的特别之处
print(a < b and b > c)

print(a > b or b < c)
print(a < b or b > c)
print(a > b or b > c)

print(not a < b)
print(not a > b)

print(10 > 20 and 10 / 0 == 1)

a = b = 20

a,b = 10,20
#交换变量
a,b = b,a
print(a,b)

a += 1 #等价于a = a + 1
a *= 1 #等价于a = a * 1
a **= 1 #等价于a = a ** 1
#......

a = -10
++a
print(a)
# a++ 这样写就会报错


